package xju_3_4.springboot_3_4.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("`user`")  // 指定表的名称
public class User {
    private Long id;
    private String name;
    private Integer age;
    private String email;
    // 逻辑删除
//    @TableLogic
    private Boolean deleted;

    @TableField(fill = FieldFill.INSERT) // 添加时自动填充
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE) // 添加和更新时自动填充
    private LocalDateTime updateTime;
}
